<?php

/**
 * Peticion form base class.
 *
 * @method Peticion getObject() Returns the current form's model object
 *
 * @package    KrazyTaxi
 * @subpackage form
 * @author     Your name here
 */
abstract class BasePeticionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDRUTA'         => new sfWidgetFormInputHidden(),
      'IDUSUARIO'      => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => true)),
      'FECHAHORARUTA'  => new sfWidgetFormDateTime(),
      'ESTADORUTA'     => new sfWidgetFormInputText(),
      'COMENTARIORUTA' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IDRUTA'         => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdruta()), 'empty_value' => $this->getObject()->getIdruta(), 'required' => false)),
      'IDUSUARIO'      => new sfValidatorPropelChoice(array('model' => 'sfGuardUserProfile', 'column' => 'IDUSUARIO', 'required' => false)),
      'FECHAHORARUTA'  => new sfValidatorDateTime(),
      'ESTADORUTA'     => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'COMENTARIORUTA' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('peticion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Peticion';
  }


}
